#ifndef BACKGROUND_H
#define BACKGROUND_H

#include <QString>
#include <QPixmap>
#include <QPainter>
#include <QSize>

#include "config.h"

namespace Map {     // 该名字空间负责地图操作

    class Background {      // Background类是一张背景图片
    public:
        explicit Background(int level, int scroll_speed =bg_scroll) : pixmap{bg_path.arg(level)}, scroll{scroll_speed}, pos{0} { }
        void update();      // 滚动
        void draw_this(QPixmap* pix) const;     // 绘制自己
        QSize size() const { return pixmap.size(); }
    private:
        QPixmap pixmap;
        int scroll;
        int pos;
    };

}

#endif // BACKGROUND_H
